package com.meilele.dao.czh;

import com.meilele.entity.czh.FiveCommit;
import com.meilele.entity.czh.FiveCommitWithBLOBs;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Repository;

@Repository
public interface FiveCommitMapper {
    @Delete({
        "delete from five_commit",
        "where commit_id = #{commitId,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(Integer commitId);

    @Insert({
        "insert into five_commit (commit_id, case_id, ",
        "commit_content, username)",
        "values (#{commitId,jdbcType=INTEGER}, #{caseId,jdbcType=INTEGER}, ",
        "#{commitContent,jdbcType=LONGVARCHAR}, #{username,jdbcType=LONGVARCHAR})"
    })
    int insert(FiveCommitWithBLOBs record);

    int insertSelective(FiveCommitWithBLOBs record);

    @Select({
        "select",
        "commit_id, case_id, commit_content, username",
        "from five_commit",
        "where commit_id = #{commitId,jdbcType=INTEGER}"
    })
    @ResultMap("com.meilele.dao.czh.FiveCommitMapper.ResultMapWithBLOBs")
    FiveCommitWithBLOBs selectByPrimaryKey(Integer commitId);

    int updateByPrimaryKeySelective(FiveCommitWithBLOBs record);

    @Update({
        "update five_commit",
        "set case_id = #{caseId,jdbcType=INTEGER},",
          "commit_content = #{commitContent,jdbcType=LONGVARCHAR},",
          "username = #{username,jdbcType=LONGVARCHAR}",
        "where commit_id = #{commitId,jdbcType=INTEGER}"
    })
    int updateByPrimaryKeyWithBLOBs(FiveCommitWithBLOBs record);

    @Update({
        "update five_commit",
        "set case_id = #{caseId,jdbcType=INTEGER}",
        "where commit_id = #{commitId,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(FiveCommit record);
}